/**
 * 修改密码
 * @return
 */
function saveUserPass(){
	//1.获取参数
	var id = $("#id").val();
	var password = $.trim($("#password").val());
	var newPassword = $.trim($("#newPassword").val());
	var confirmPassword = $.trim($("#confirmPassword").val());
	
	//2.验证参数
	
	//3.发送请求
	var url = ctx + "/saveUserPass.html?ajax=true";
	var param = "&id=" + id + "&password=" + password + "&newPassword=" + newPassword + "&confirmPassword=" + confirmPassword;
	var sf = function (msg) {
		if (msg == 1 || msg == "1" || msg == "\"1\"") {
			art.dialog({
			    id: "sucId",
			    icon: "succeed",
			    content: "保存成功！"
			});
			art.dialog({id: "sucId"}).title("2秒后关闭").time(2);
		}else if (msg == 2 || msg == "2" || msg == "\"2\"") {
			art.dialog({
			    id: "warnId",
			    icon: "warning",
			    content: "原密码与当前密码不匹配，请重新输入！"
			});
			art.dialog({id: "warnId"}).title("2秒后关闭").time(2);
		}else{
			art.dialog({
			    id: "errId",
			    icon: "error",
			    content: "保存失败，请刷新页面重试！"
			});
			art.dialog({id: "errId"}).title("2秒后关闭").time(2);
		}
	};
	ajax(url, param, sf);
}


/***
 *	修改个人基本信息 
 */
function saveUserInfo(){
	//1.获取参数
	var id = $("#id").val();
	var displayName = $.trim($("#displayName").val());
	var nickName = $.trim($("#nickName").val());
	var gender = $("#gender").val();
	var year = $("#year").val();
	var month = $("#month").val();
	var date = $("#date").val();
	var province = $("#province").val();
	var city = $("#city").val();
	var county = $("#county").val();
	
	
	//2.验证参数
	
	//3.发送请求
	var url = ctx + "/saveUserInfo.html?ajax=true";
	var param = "&user.id=" + id + "&user.displayName=" + encodeURIComponent(displayName) + "&userInfo.nickName=" + encodeURIComponent(nickName) + "&user.gender=" + gender + "&userInfo.birthYear=" + year + "&userInfo.birthMonth=" + month + "&userInfo.birthDay=" + date + "&userInfo.province=" + encodeURIComponent(province) + "&userInfo.city=" + encodeURIComponent(city) + "&userInfo.county=" + encodeURIComponent(county);
	var sf = function (msg) {
		if (msg == 1 || msg == "1" || msg == "\"1\"") {
			art.dialog({
			    id: "sucId",
			    icon: "succeed",
			    content: "保存成功！"
			});
			art.dialog({id: "sucId"}).title("2秒后关闭").time(2);
		}else{
			art.dialog({
			    id: "errId",
			    icon: "error",
			    content: "保存失败，请刷新页面重试！"
			});
			art.dialog({id: "errId"}).title("2秒后关闭").time(2);
		}
	};
	ajax(url, param, sf);
}
